package com.qlogic.commons.platform.impls.ftp;

public class FTPException extends Exception {

    /**
	 * 
	 */
	private static final long serialVersionUID = 2048395796894420850L;
	/**
     *  Integer reply code
     */
    private int replyCode = -1;

	/**
	 * @see java.lang.Throwable#Throwable(String)
	 */
    public FTPException(String msg) {
        super(msg);
    }

	/**
	 * Method FTPException.
	 * @param msg
	 * @param replyCode
	 */
    public FTPException(String msg, String replyCode) {

        super(msg);

        // extract reply code if possible
        try {
            this.replyCode = Integer.parseInt(replyCode);
        }
        catch (NumberFormatException ex) {
            this.replyCode = -1;
        }
    }


	/**
	 * Method getReplyCode.
	 * @return int
	 */
    public int getReplyCode() {
        return replyCode;
    }

}
